﻿@model PagedList<View_AmountLog>
@{
    ViewBag.Title = "资金明细";
    Layout = "~/Views/Shared/_ContentLayout.cshtml";


    AmountLogListModel paramModel = new AmountLogListModel();
    if (ViewBag.paramModel != null)
    {
        paramModel = (AmountLogListModel)ViewBag.paramModel;
    }
    ADZ_MasterEntities dbcontext = new ADZ_MasterEntities();
    Dictionary<string, string> dc = new Dictionary<string, string>();
}

<form id="S_Form" class="form-inline definewidth m20" action="@Url.Action("amountloglist", "account")" method="get">
    <div class="form_query">
        <div>
            <input type="hidden" name="uid" id="uid" value="@paramModel.uid">&nbsp;
        </div>
        <div>
            代购编号：
            <input type="text" name="replace_buyer_NO" id="replace_buyer_NO" class="abc input-default" placeholder="" value="@paramModel.replace_buyer_NO">&nbsp;
        </div>
        <div>
            手机号：
            <input type="text" name="account_mobile" id="account_mobile" class="abc input-default" placeholder="" value="@paramModel.account_mobile">&nbsp;
        </div>
        <div>
            会员名称：
            <input type="text" name="member_name" id="member_name" class="abc input-default" placeholder="" value="@paramModel.member_name">&nbsp;
        </div>
        <div>
            订单类型：
            <select id="order_type" name="order_type">
                @{
                    dc = new Dictionary<string, string>();
                    var list = YiYiTong.Rocket.Helper.EnumHelper.GetEnumItems(typeof(OrderType));
                    foreach (var item in list)
                    {
                        dc.Add(item.Value.ToString(), item.Description);
                    }
                }
                @HtmlPagerHelper.ShowSelectOpton(dc, paramModel.order_type.ToString());
            </select>&nbsp;
        </div>
        <div>
            操作时间：
            <input type="text" name="beg_time" class="calendar calendar-time" id="beg_time" value="@paramModel.beg_time.ToString(1)"> - <input type="text" name="end_time" class="calendar calendar-time" id="end_time" value="@paramModel.end_time.ToString(1)">&nbsp;
        </div>
        <div>
            @{Html.RenderPartial(Url.Content("~/Views/Common/PageSize.cshtml"), paramModel);}
        </div><div>
            <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
            @if (paramModel.uid > 0)
            {
                <button type="button" class="btn btn-success" name="backid" id="backid">返回</button>
            }
        </div>
    </div>
</form>

<table class="table table-bordered table-hover definewidth m10">
    <thead>
        <tr>
            <th>代购编号</th>
            <th>手机号</th>
            <th>会员名称</th>
            <th>金额</th>
            <th>订单类型</th>
            <th>关联订单</th>
            <th>操作时间</th>
            <th>备注</th>
        </tr>
    </thead>
    @if (Model != null && Model.Count != 0)
    {
        int index = 0;
        foreach (var m in Model)
        {
            index++;
            <tr class="@HtmlPagerHelper.TrClass(index)">
                <td>@m.replace_buyer_NO</td>
                <td>@m.account_mobile</td>
                <td>@m.member_name</td>
                <td> @m.amount </td>
                <td>
                    @switch (m.order_type)
                    {
                        case 1:
                            @:<div class="green">充值</div>
                            break;
                        case 2:
                            @:<div class="green">支付</div>
                            break;
                    }
                </td>
                <td>@m.orderid</td>
                <td>@m.create_time.ToString(1)</td>
                <td>@m.message</td>
            </tr>
        }
    }
</table>
<div class="inline pull-left total">
    总行数：@ViewData["AllCount"] 
</div>
<div class="inline pull-right page">
    @if (Model != null)
    {
        @Html.Pager(Model, HtmlPagerHelper.BasePagerOption)
    }
</div>

